<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center chooseCompany_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub chooseCompany_fd0_0'>
          <view class='flex flex-wrap align-center chooseCompany_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  chooseCompany_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='chooseCompany_fd0_0_c1_c0'>选择企业</text>
          </view>
          <view class='flex flex-wrap align-center justify-end chooseCompany_fd0_0_c0' @tap.stop="handleJumpDiy"
            data-type="redirectTo" :data-url="`/pages/grzx/qiyeInfo/qiyeInfo`">
            <text>添加企业</text>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view class='flex flex-wrap align-center chooseCompany_fd1_0'>
          <text class='fu-iconfont2  chooseCompany_fd1_0_c0'>&#xe77e;</text>
          <benben-input type="text" :placeholder="`请输入`" v-model="keywords" @confirm="getListFunc" confirm-type="done"
            :maxlength="-1" :adjust-position='true' placeholder-style="color:#999;font-size:28rpx" />
        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center">
        <view class='flex flex-wrap align-center justify-between chooseCompany_fd2_0' v-for="(item,index) in dataList"
          :key="index" @click.stop="choose(item)">
          <view class='flex flex-wrap align-stretch flex-sub'>
            <image class='chooseCompany_fd2_0_c0_c0' mode="aspectFill" :src='item.logo'></image>
            <view class='flex flex-direction flex-wrap align-stretch flex-sub chooseCompany_fd2_0_c0_c1'>
              <view class='flex flex-wrap align-end'>
                <text class='chooseCompany_fd2_0_c0_c1_c0_c0'>{{item.mingcheng}}</text>
                <text class='chooseCompany_fd2_0_c0_c1_c0_c1'>距您{{item.distance}}</text>
              </view>
              <view class='flex flex-wrap align-center chooseCompany_fd2_0_c0_c1_c1'>
                <text class='chooseCompany_fd2_0_c0_c1_c1_c0' v-for="(itemC,indexC) in item.company_service_list"
                  :key="indexC">{{itemC}}</text>
              </view>
            </view>
          </view>
        </view>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>

      <!---flex布局flex布局结束-->
      <benben-popup v-model="popupShow1717472690849" :mask="true" :mask-close-able="false" mode='bottom' :z-index='999'>
        <!---flex布局flex布局开始-->
        <view class="flex flex-wrap align-center justify-between benben-flex-layout chooseCompany_flex_3">
          <benben-input class='chooseCompany_fd3_0' type="text" :placeholder="`请输入`" confirm-type="done" :maxlength="-1"
            :adjust-position='true' placeholder-style="color:#999;font-size:28rpx" />
          <button class='chooseCompany_fd3_1'>添加</button>
        </view>

        <!---flex布局flex布局结束-->

      </benben-popup>


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        dataList: [],
        "popupShow1717472690849": false,
        keywords: '',
        lat: '',
        lng: '',
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      let that = this
      uni.showModal({
        title: '位置授权信息提示',
        content: '用于获取周边信息',
        success: function(res1) {
          if (res1.confirm) {
            uni.getLocation({
              type: 'gcj02',
              geocode: true,
              success: (res) => {
                that.lat = res.latitude;
                that.lng = res.longitude;
                that.getListFunc()
              },
              complete: (complete) => {
                console.log('complete', complete)
              }
            })
          }
        }
      })

      // that.getListFunc()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {

    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      choose(item) {
        uni.$emit('qite', item)
        uni.navigateBack()
      },
      getListFunc() {
        this.minixPagingListsApi = global.apiUrls.post6651b78154bee;
        this.pageingListApiMethod = 'post';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          keywords: this.keywords,
          lat: this.lat,
          lng: this.lng,
        }
        this.listData = [];
        this.dataList = this.listData;
        this.pagingListToggle();

      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: var(--benbenbgColor1);
    background-size: 100% auto;
  }

  .chooseCompany_flex_0 {
    border-bottom: 1px solid #eee;
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .chooseCompany_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .chooseCompany_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .chooseCompany_fd0_0_c0 {
    width: 120rpx;
  }

  .chooseCompany_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .chooseCompany_fd1_0_c0 {
    color: var(--benbenFontColor2);
    margin: 0rpx 16rpx 0rpx 0rpx;
    font-size: 24rpx;
  }

  .chooseCompany_fd1_0 {
    background: #F9F9F9;
    border-radius: 34rpx 34rpx 34rpx 34rpx;
    width: 686rpx;
    height: 64rpx;
    padding: 0rpx 0rpx 0rpx 16rpx;
    margin: 24rpx auto 24rpx auto;
  }

  .chooseCompany_fd2_0_c0_c1_c1_c0 {
    border: 1px solid #ED914A;
    background: #FFFFFF;
    border-radius: 4rpx 4rpx 4rpx 4rpx;
    color: var(--benbenFontColor6);
    font-size: 22rpx;
    padding: 6rpx 10rpx 6rpx 10rpx;
    margin: 0rpx 12rpx 0rpx 0rpx;
  }

  .chooseCompany_fd2_0_c0_c1_c1 {
    margin: 18rpx 0rpx 0rpx 0rpx;
    width: 450rpx;
  }

  .chooseCompany_fd2_0_c0_c1_c0_c1 {
    color: rgba(170, 170, 170, 1);
    font-size: 24rpx;
    margin: 0rpx 0rpx 0rpx 16rpx;
  }

  .chooseCompany_fd2_0_c0_c1_c0_c0 {
    font-size: 30rpx;
    font-weight: 600;
  }

  .chooseCompany_fd2_0_c0_c1 {
    margin: 0rpx 0rpx 0rpx 24rpx;
  }

  .chooseCompany_fd2_0_c0_c0 {
    width: 120rpx;
    height: 120rpx;
    border-radius: 16rpx;
  }

  .chooseCompany_fd2_0 {
    border-bottom: 1px solid #eee;
    background: #FFFFFF;
    margin: 0rpx auto 24rpx auto;
    width: 686rpx;
    border-radius: 12rpx 12rpx 12rpx 12rpx;
    padding: 24rpx;
  }

  .chooseCompany_flex_3 {
    background: var(--benbenbgColor1);
    padding: 32rpx;
    background-size: 100% auto;
  }

  .chooseCompany_fd3_1 {
    background: #5ECA71;
    border-radius: 44rpx 44rpx 44rpx 44rpx;
    width: 104rpx;
    line-height: 48rpx;
    font-size: 24rpx;
    color: #fff;
    height: 48rpx;
  }

  .chooseCompany_fd3_0 {
    background: #F8F8F8;
    border-radius: 36rpx 36rpx 36rpx 36rpx;
    line-height: 60rpx;
    height: 60rpx;
    padding: 0rpx 0rpx 0rpx 24rpx;
    width: 550rpx;
  }
</style>
